#include <iostream>
using namespace std;

class CSingleton{
	private:
		int x,y;
		static CSingleton * PSingle;
		CSingleton(){};
	public:
		static CSingleton * Instance(){
			if (!PSingle){
				PSingle = new CSingleton();
			}
			return PSingle;
		}
		void Set(int a,int b){
			x=a;
			y=b;
		}
		void Print(){
			cout<<"x="<<x<<",y="<<y<<endl;
		}
};

CSingleton *CSingleton::PSingle = NULL;

int main(void){
	CSingleton * Ps = CSingleton::Instance();
	if (Ps){
		Ps->Set(3,5);
		Ps->Print();
	}
	return 0;
}
